package ar.com.solidussource.howmuchservices.common.entities.filter;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import ar.com.solidussource.framework.backend.dao.filter.OrderedFilter;

public class LocationFilter extends OrderedFilter {
	
	private Integer provinceId;

	public Integer getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(Integer provinceId) {
		this.provinceId = provinceId;
	}

	@Override
	public void fillCriteriaNotPagination(Criteria arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void fillCriteriaNoOrder(Criteria criteria) {
		if (getProvinceId() != null) {
			criteria.add(Restrictions.eq("province.id", this.provinceId));
		}			
		
	}

}
